<?php
/**
 * Created by PhpStorm.
 * User: zxy
 * Date: 2018/2/6
 * Time: 16:47
 */

class DBUtils
{
    public function getDbConnect(){
        $mysqli = new mysqli('mysql.hostinger.com.hk','u490066653_db','1574495418','u490066653_db');
        $mysqli->set_charset("utf8");
        if (mysqli_connect_errno()) {
            printf("Connect failed: %s\n", mysqli_connect_error());
            exit();
        }
        return $mysqli;
    }
    public function fomatSqlResult($result){
        $ret = array();

        while($row = $result->fetch_assoc() ){
            $ret[]  = $row;
        }
        return $ret;
    }
}